/*	Model.h	-	Wallace Brown
 *
 *	Encapsulates a model. Has a vao handle, (will have textures), (will have transformation
 *	matrices).
 */
#pragma once
#include "Geometry_Defines.h"

class Model
{
public:
	// Creates a model with a generated key of the form "model_0", "model_1", etc....
	Model();
	Model(std::string key);
	~Model(void);

	GLuint* vao();
	GLuint numIndices();

	// Get the minimum vertex in the model.
	glm::vec3 Get_Min();

	// Get the maximum vertex in the model.
	glm::vec3 Get_Max();

	void Set_vao(GLuint& vao);
	void Set_numIndices(GLuint num);
	void Set_Vertices(std::vector<Vertex_PNT> &_vertices);
	void Add_IndexBuffer(GLuint* index_buffer);

	void Delete_Vertices(void);
	void Delete_IndexBuffer(void);
private:
	// Generates a model key in the form of "model_0", "model_1", and so on.
	std::string CreateModelID();

	// Generate our models min a max.
	void find_extents();

	GLuint _vao[1],_numIndices;
	std::vector<Vertex_PNT> *_pvertices;
	std::vector<GLuint*> _index_buffers;
	std::string			_key;

	glm::vec3 _min, _max;

	// A way to automatically create model keys with a default constructor.
	static unsigned int model_id_counter;
};